<template lang="pug">
q-scroll-area(style="height: calc(100vh - 82px)")
  q-tree(node-key="name" :nodes="account_store.menu_list" accordion)
    template(v-slot:default-header="{ node }")
      q-btn(flat dense :label="node.label" :icon="node.icon" class="full-width text-white" align="left"
        @click="node.handler")
</template>

<script setup>
import {useAccountStore} from "~/utils/store/account.js";
// import {useRoute} from "vue-router";
import {computed} from "vue";

const account_store = useAccountStore()
// const route = useRoute()
const menu = computed(() => {
  if (!account_store.hasOwnProperty('menu_list') || account_store.menu_list.length === 0) {
    return []
  }
  return account_store.menu_list
})
// const route_name = computed(() => {
//   if (!route.name) return ''
//   return route.name
// })
//
// const showMenu = () => {
//   console.log('menu', menu.value)
// }


</script>

<style scoped>

</style>